package com.weixin.paleituo.view;


import android.content.Context;

import com.yanyusong.y_divideritemdecoration.Y_Divider;
import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder;
import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration;

public class SharedTemplateItemDecoration extends Y_DividerItemDecoration {

    public SharedTemplateItemDecoration(Context context) {
        super(context);
    }

    @Override
    public Y_Divider getDivider(int itemPosition) {
        Y_Divider divider = null;

        if (itemPosition == 0) {
            divider = new Y_DividerBuilder()
                    .setRightSideLine(true, 0xfff5f5f5, 20, 0, 0)
                    .setLeftSideLine(true, 0xfff5f5f5, 20, 0, 0)
                    .setBottomSideLine(true, 0xfff5f5f5, 10, 0, 0)
                    .create();
        } else {
            if (itemPosition % 2 == 0) {
                divider = new Y_DividerBuilder()
                        .setRightSideLine(true, 0xfff5f5f5, 20, 0, 0)
                        .setBottomSideLine(true, 0xfff5f5f5, 10, 0, 0)
                        .setLeftSideLine(true, 0xfff5f5f5, 10, 0, 0)
                        .create();
            } else {
                divider = new Y_DividerBuilder()
                        .setRightSideLine(true, 0xfff5f5f5, 10, 0, 0)
                        .setBottomSideLine(true, 0xfff5f5f5, 10, 0, 0)
                        .setLeftSideLine(true, 0xfff5f5f5, 20, 0, 0)
                        .create();
            }


        }


        return divider;
    }
}
